<?php

class PindaoAction extends Action {
    public function index(){
    	import('ORG.Net.Api');
        $apiurl = new Api();
        $uid=$_SESSION['phone_uid'];
        $sid=$_SESSION['s_id'];
        $app_kind=$_SESSION['ibg_k'];
		$img=$apiurl->loadimg();
    	$hoturl=$apiurl->hot($app_kind,365);
        $newhturl=$apiurl->newht($app_kind,365);
        $hotpdurl=$apiurl->hotpd($app_kind,365);
        $hotuserurl=$apiurl->hotuser($app_kind,365);
        $hot=file_get_contents($hoturl);
        $hotinfo=json_decode($hot,true); 
          
        $newht=file_get_contents($newhturl);
        $newh=json_decode($newht,true);
        
        $hotpd=file_get_contents($hotpdurl);
        $hotpindao=json_decode($hotpd,true);
        
        $hotuser=file_get_contents($hotuserurl);
        $hotu=json_decode($hotuser,true);
        
        unset($hotinfo['size']);
        foreach ($hotinfo as $k => $v) {
            $this->assign("hot",$v);
        }
        
        unset($newh['size']);
        foreach ($newh as $ke => $va) {
            $this->assign("newht",$va);    
            // echo "<pre>";
            // dump($va);        
        }
        
        unset($hotpindao['size']);
        foreach ($hotpindao as $key => $value){
            $this->assign("hotpd",$value);
        }
        
        foreach ($hotu as $kes=>$vas){
            $this->assign("hotu",$vas);
        }
        
        $this->assign("img",$img);
    	$this->display();
        //echo "<pre>";
//        dump($hotu);
    }

    public function page(){
    	$this->display();
    }

}